﻿package MyUI{
	import flash.display.*;
	import flash.events.*;
	public class MyUIObject extends Sprite{
		public function drag(){
			addEventListener(MouseEvent.MOUSE_DOWN,onStartDrag);
			addEventListener(MouseEvent.MOUSE_UP,onStopDrag);
		}
		public function click(onClick:Function){
			addEventListener(MouseEvent.CLICK,onClick);
		}
		function onStartDrag(e:MouseEvent){
			startDrag();
		}
		function onStopDrag(e:MouseEvent){
			stopDrag();
		}
	}
}